package com.music.entity;

/**
 * 订单明细类
 * 
 * @author Administrator
 *
 */
public class OrderDetail {
	/**
	 * 订单明细id
	 */
	private int id;
	/**
	 * 订单
	 */
	private Order order;
	/**
	 * 唱片
	 */
	private Album album;
	/**
	 * 订单数量
	 */
	private int quantity;
	
	public Album getAlbum() {
		return album;
	}

	public void setAlbum(Album album) {
		this.album = album;
	}
	/**
	 * 小计
	 */
	private double subtotal;
	
	public double getSubtotal() {
		subtotal = quantity * album.getPrice();
		return subtotal;
	}

	public void setSubtotal(double subtotal) {
		this.subtotal = subtotal;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Order getOrder() {
		return order;
	}
	public void setOrder(Order order) {
		this.order = order;
	}
	
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	public OrderDetail(int id, Order order, Album album, int quantity) {
		super();
		this.id = id;
		this.order = order;
		this.album = album;
		this.quantity = quantity;
	}
	public OrderDetail() {
		super();
	}

	

}
